#ifndef WIDGET_H
#define WIDGET_H


#include <QWidget>
#include<QGraphicsPixmapItem>
#include<QGraphicsView>
#include<QGraphicsScene>
#include<QList>
#include"bullet.h"
#include"enemy.h"
#include"score.h"


namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    void BGMove();


    void PlaneMove();

    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);

    void PlaneBulletShoot();


    void CreatEnemy();
    void Collision();
    void PlaneCollision();

private:
    Ui::Widget *ui;

    QGraphicsView mGameview;
    QGraphicsScene mScene;
    QGraphicsScene mStartScence;
    QGraphicsScene mGameOverScence;

    QGraphicsPixmapItem mPlane;
    QGraphicsPixmapItem mBackGround1;
    QGraphicsPixmapItem mBackGround2;

    QTimer *mBGMoveTimer;
    QTimer *mPlaneMoveTimer;
    QTimer *mPlaneShootTimer;
    QTimer *mBulletMoveTimer;
    QTimer *mEnemyCreatTimer;
    QTimer *mEnemyMoveTimer;
    QTimer *Gamesover;



    QList<int> mKeyList;
    QList<Bullet*> mBUlletList;
    QList<Enemy*> mEnemyList;
    Score *score;
};

#endif // WIDGET_H
